package com.xuerhua.yxt.reqVo;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.xuerhua.yxt.utils.DateUtil;
import com.xuerhua.yxt.utils.StringUtil;

public class TeacherWorkSignReqVO extends BasePageQueryVO {

	private Integer teacherId;
	
	private String teacherName;
	
	private Integer signType;
	
	private List<String> dateList = new ArrayList<>();
	
	private String startDate;
	
	private String endDate;

	public Integer getTeacherId() {
		return teacherId;
	}

	public void setTeacherId(Integer teacherId) {
		this.teacherId = teacherId;
	}

	public String getTeacherName() {
		return teacherName;
	}

	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}

	public Integer getSignType() {
		return signType;
	}

	public void setSignType(Integer signType) {
		this.signType = signType;
	}

	public List<String> getDateList() {
		Date sDate = StringUtils.isBlank(this.startDate) ? new Date() : DateUtil.strToDate(this.startDate, DateUtil.DEFAULT_DATE_FORMAT3);
		Date eDate = StringUtils.isBlank(this.endDate) ? new Date() : DateUtil.strToDate(this.endDate, DateUtil.DEFAULT_DATE_FORMAT3);
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(sDate);
		while(calendar.getTime().compareTo(eDate) <= 0){
			dateList.add(DateUtil.dateToStr(calendar.getTime(), DateUtil.DEFAULT_DATE_FORMAT3));
			calendar.add(Calendar.DATE, 1);
		}
		if(StringUtil.isNullOrEmpty(dateList)) {
			dateList.add(DateUtil.dateToStr(new Date(), DateUtil.DEFAULT_DATE_FORMAT3));
		}
		return dateList;
	}

	public void setDateList(List<String> dateList) {
		this.dateList = dateList;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}
	
}
